<ui:composition 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<p:panel id="panel_responsavel_listagem" visible="#{controleAbasMBean.exibirAbaResponsaveis and not empty responsavelMBean.responsaveis}">
		<p:panelGrid style="width:100%" styleClass="bordas_radius_tabela">
			<f:facet name="header">
				<p:row>
					<p:column colspan="3">#{msg.label_lista_responsaveis}</p:column>
				</p:row>
				<p:row>
					<p:column styleClass="bold centralizar-texto fundo_branco um_terco_largura">#{msg.label_aluno}</p:column>
	    			<p:column styleClass="bold centralizar-texto fundo_branco um_terco_largura">#{msg.label_nome_responsavel}</p:column>
	    			<p:column styleClass="bold centralizar-texto fundo_branco um_terco_largura">#{msg.label_relacao}</p:column>
				</p:row>
			</f:facet>
				<ui:repeat var="entry" value="#{responsavelMBean.responsaveis.entrySet().toArray()}">
				<p:row>
					<p:column rowspan="#{entry.value.size() + 1}"> 
						<h:outputText value="#{entry.key.nome}"/>
					</p:column>
					<ui:repeat var="responsavel" value="#{entry.value}">
						<p:row>
							<p:column>
								<h:outputText value="#{responsavel.nome}" />
							</p:column>
							<p:column>
								<h:outputText value="#{responsavel.relacao.valor}" />
							</p:column>
						</p:row>
					</ui:repeat>
				</p:row>
			</ui:repeat>
			<f:facet name="footer">
				<p:row>
					<p:column colspan="3" styleClass="ui-paginator ui-paginator-bottom ui-widget-header ui-corner-bottom">
						<c:forEach begin="1" end="#{responsavelMBean.totalPaginas}" varStatus="pagina">
							<p:commandLink styleClass="ui-paginator-page ui-state-default ui-corner-all" actionListener="#{responsavelMBean.paginarResponsaveis}" update="panel_responsavel_listagem">
								#{pagina.current}
								<f:param name="proxima_pagina" value="#{pagina.current}"/>
							</p:commandLink>
						</c:forEach>
					</p:column>
				</p:row>
			</f:facet>
		</p:panelGrid>
		
	</p:panel>
</ui:composition>